#include "qerreur.h"

QErreur::QErreur(QString text,QString key,quint32 importance,QColor color,QObject *parent)
	: QObject(parent),m_text(text),m_key(key),m_importance(importance),m_color(color)
{
	#ifdef	LOG_ACTIVATED
	__TRACE__
	#endif
	#ifdef	LEAK_ACTIVATED
	__LEAK__
	#endif
}

QErreur::~QErreur()
{
	#ifdef	LOG_ACTIVATED
	__TRACE__
	#endif
	#ifdef	LEAK_ACTIVATED
	__LEAK__
	#endif
}


QString QErreur::description(QList<quint32> lines)
{
	#ifdef	LOG_ACTIVATED
	__TRACE__
	#endif
	#ifdef	LEAK_ACTIVATED
	__LEAK__
	#endif
	QString str;
	foreach(quint32 line,lines)
		str.append(QString("%1, ").arg(line));
	if(str.contains(", "))
		str = str.left(str.size() -2);
	QString s = QString(ERR_LINE).arg(str);
	return m_text.arg(s);
}
